﻿using System.Collections.ObjectModel;
using System.ComponentModel;

namespace _03_View_Model_MVVM_Basics.Directory.ViewModels
{
	public class DirectoryStructureViewModel
	{
		public ObservableCollection<DirectoryItemViewModel> Items { get; set; } = new ObservableCollection<DirectoryItemViewModel>();

		public DirectoryStructureViewModel()
		{
			var drives = DirectoryStructure.GetDrives().Select(fullPath => new DirectoryItemViewModel(fullPath.Type, fullPath.FullPath));
			if (drives != null)
			{
				foreach (var drive in drives)
				{
					Items.Add(drive);
				}
			}
        }
	}
}
